import { pageLoader } from "@/pages/Common/CommonData";
import Comprehensive from "@/pages/Comprehensive";
import Entertainment from "@/pages/Entertainment";
import Root from "@/pages/Root";
import Subscribe from "@/pages/Subscribe";
import Technology from "@/pages/Technology";
import UserHome from "@/pages/UserHome";
import UserLogin from "@/pages/UserLogin";
import { createBrowserRouter } from "react-router-dom";

const routers = createBrowserRouter([
  {
    path: "/",
    element: <Root />,
    children: [
      {
        index: true,
        path: "",
        element: <Comprehensive />,
        loader: pageLoader("comprehensive"),
      },
      {
        path: "comprehensive",
        element: <Comprehensive />,
        loader: pageLoader("comprehensive"),
      },
      {
        path: "technology",
        element: <Technology />,
        loader: pageLoader("technology"),
      },
      {
        path: "entertainment",
        element: <Entertainment />,
        loader: pageLoader("entertainment"),
      },
      {
        path: "subscribe",
        element: <Subscribe />,
        loader: pageLoader("subscribe"),
      },
      {
        path: "user",
        children: [
          {
            index: true,
            element: <UserHome />,
          },
          {
            path: "home",
            element: <UserHome />,
          },
          {
            path: "login",
            element: <UserLogin />,
          },
        ]
      }
    ],
  },
]);

export default routers;
